Optimal. Leaf size=57 \[ -\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)-\frac{1}{6} (e+g) \log \left (1-x^2\right )+\frac{1}{6} (e+4 g) \log \left (4-x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0722953, antiderivative size = 57, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {1673, 1166, 207, 1247, 632, 31} \[ -\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)-\frac{1}{6} (e+g) \log \left (1-x^2\right )+\frac{1}{6} (e+4 g) \log \left (4-x^2\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1673
Rule 1166
Rule 207
Rule 1247
Rule 632
Rule 31
Rubi steps
\begin{align*} \int \frac{d+e x+f x^2+g x^3}{4-5 x^2+x^4} \, dx &=\int \frac{d+f x^2}{4-5 x^2+x^4} \, dx+\int \frac{x \left (e+g x^2\right )}{4-5 x^2+x^4} \, dx\\ &=\frac{1}{2} \operatorname{Subst}\left (\int \frac{e+g x}{4-5 x+x^2} \, dx,x,x^2\right )-\frac{1}{3} (d+f) \int \frac{1}{-1+x^2} \, dx+\frac{1}{3} (d+4 f) \int \frac{1}{-4+x^2} \, dx\\ &=-\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)+\frac{1}{6} (-e-g) \operatorname{Subst}\left (\int \frac{1}{-1+x} \, dx,x,x^2\right )+\frac{1}{6} (e+4 g) \operatorname{Subst}\left (\int \frac{1}{-4+x} \, dx,x,x^2\right )\\ &=-\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)-\frac{1}{6} (e+g) \log \left (1-x^2\right )+\frac{1}{6} (e+4 g) \log \left (4-x^2\right )\\ \end{align*}
Mathematica [A] time = 0.032265, size = 68, normalized size = 1.19 \[ \frac{1}{12} (-2 \log (1-x) (d+e+f+g)+\log (2-x) (d+2 e+4 f+8 g)+2 \log (x+1) (d-e+f-g)-\log (x+2) (d-2 e+4 f-8 g)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.01, size = 114, normalized size = 2. \begin{align*} -{\frac{\ln \left ( 2+x \right ) d}{12}}+{\frac{\ln \left ( 2+x \right ) e}{6}}-{\frac{\ln \left ( 2+x \right ) f}{3}}+{\frac{2\,\ln \left ( 2+x \right ) g}{3}}+{\frac{\ln \left ( 1+x \right ) d}{6}}-{\frac{\ln \left ( 1+x \right ) e}{6}}+{\frac{\ln \left ( 1+x \right ) f}{6}}-{\frac{\ln \left ( 1+x \right ) g}{6}}+{\frac{\ln \left ( x-2 \right ) d}{12}}+{\frac{\ln \left ( x-2 \right ) e}{6}}+{\frac{\ln \left ( x-2 \right ) f}{3}}+{\frac{2\,\ln \left ( x-2 \right ) g}{3}}-{\frac{\ln \left ( x-1 \right ) d}{6}}-{\frac{\ln \left ( x-1 \right ) e}{6}}-{\frac{\ln \left ( x-1 \right ) f}{6}}-{\frac{\ln \left ( x-1 \right ) g}{6}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.966077, size = 82, normalized size = 1.44 \begin{align*} -\frac{1}{12} \,{\left (d - 2 \, e + 4 \, f - 8 \, g\right )} \log \left (x + 2\right ) + \frac{1}{6} \,{\left (d - e + f - g\right )} \log \left (x + 1\right ) - \frac{1}{6} \,{\left (d + e + f + g\right )} \log \left (x - 1\right ) + \frac{1}{12} \,{\left (d + 2 \, e + 4 \, f + 8 \, g\right )} \log \left (x - 2\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 3.66056, size = 197, normalized size = 3.46 \begin{align*} -\frac{1}{12} \,{\left (d - 2 \, e + 4 \, f - 8 \, g\right )} \log \left (x + 2\right ) + \frac{1}{6} \,{\left (d - e + f - g\right )} \log \left (x + 1\right ) - \frac{1}{6} \,{\left (d + e + f + g\right )} \log \left (x - 1\right ) + \frac{1}{12} \,{\left (d + 2 \, e + 4 \, f + 8 \, g\right )} \log \left (x - 2\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14393, size = 93, normalized size = 1.63 \begin{align*} -\frac{1}{12} \,{\left (d + 4 \, f - 8 \, g - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) + \frac{1}{6} \,{\left (d + f - g - e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac{1}{6} \,{\left (d + f + g + e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac{1}{12} \,{\left (d + 4 \, f + 8 \, g + 2 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]